package com.meichis.yndms.adapter;

import android.content.Context;

import com.meichis.mcsappframework.adapter.recyclerview.CommonAdapter;
import com.meichis.mcsappframework.adapter.recyclerview.base.ViewHolder;
import com.meichis.yndms.R;
import com.meichis.yndms.model.StayInOrderItem;

import java.util.List;

/**
 * @author xmy
 * @title
 * @remake
 * @create 2022-05-19 21:37
 */
public class StayInOrderDetailAdapter extends CommonAdapter<StayInOrderItem> {

    public StayInOrderDetailAdapter(Context context, int layoutId, List<StayInOrderItem> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, StayInOrderItem item, int position) {
        holder.setText(R.id.tv_name, item.getProductName());
        holder.setText(R.id.tv_code, item.getProductNo());
        holder.setText(R.id.tv_count, item.getQuantity()+"件");
        holder.setText(R.id.tv_weight, item.getWeight() + "吨");

        if (position + 1 == mDatas.size()) {
            holder.setBackgroundRes(R.id.ll_item, R.drawable.shape_fillet_bottom_solid_white);
        } else {
            holder.setBackgroundRes(R.id.ll_item, R.color.white);
        }

    }
}
